<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        .box {
            width: 200px;
            height: 300px;
            margin: 100px auto 0;
            position: relative;
            transform-style: preserve-3d;
            transform: perspective(700px) rotateY(0deg);
            transition: 3s all ease;
        }
        .box div {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            transform: translateZ(0);
            color: #fff;
            font-size: 30px;
            line-height: 300px;
            text-align: center;
        }
        div.front {
            background: pink;
            transform: translateZ(1px);
        }
        div.back {
            background: #ff5700;
            transform: translateZ(-1px) scaleX(-1);
        }
        .box:active {
            transform: perspective(700px) rotateY(240deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="front">前</div>
        <div class="back">后</div>
    </div>
</body>
</html>